let Rule = require("../rule.js")
class DateRule extends Rule{
	name(){
		return 'date'
	}
	check(column,value,values,params){
		var re = /^\d{1,4}(\-|\/)\d{1,2}((\-|\/)\d{1,2}( \d{1,2}\:\d{1,2}(\:\d{1,2})?)?)?$/;
		return re.test(value) && (new Date(value)).getDate()>=1
	}
}
module.exports = DateRule